# -*- coding:utf-8 -*-
"""
配置（读取配置）文件
1、计算周几是那一天
"""
import time

def wdaytodate(wday):

    now = time.localtime()
    now_wday = now.tm_wday
    difference_value_week = wday-1-now_wday
    if difference_value_week < 0 :  
        difference_value_week = difference_value_week + 7
    daystamp = time.time() + difference_value_week*24*60*60
    day = time.localtime(daystamp)
    print(day)
    mon = f'{day.tm_mon}'
    if len(mon) == 1:
        mon = f'0{mon}'
    mday = f'{day.tm_mday}'
    if len(mday) == 1:
        mday = f'0{mday}'
    return f'{day.tm_year}-{mon}-{mday}'
if __name__ == '__main__':
    day = wdaytodate(5)
    print(day)